<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>服装款式</title>
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
    <script src="${ctxStatic}/js/DateTimePicker.js"></script>
    <script src="${ctxStatic}/js/layer.js"></script>
    <script src="${ctxStatic}/js/style.js"></script>
   	<script src="${ctxStatic}/dateCalendar/WdatePicker.js"></script>
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <script>
    $(document).ready(function() {
    	$("#orderTypeCD").select2();
    	$("#indentStatusCD").select2();
        $(window.parent.$('#dtBox1')).DateTimePicker(
                {
                    dateFormat: "yyyy-MM-dd HH:mm",
                    parentElement: ".timeBox",
                }
        );

    });
	
	$(function(){
            $(".tabBox ul li").each(function(){
                var index=$(this).index();

                $(".tabBox ul li").eq(0).addClass("active");

                $(this).click(function(){

                    //alert(index);

                    $(this).addClass("active").siblings().removeClass("active");

                    //$(".tabBoxSm > .tabSm").eq(index).stop(true).show().siblings().stop(true).hide();
					$("#ulSelected").val($(this).val());
					searchListForm();
					var tableW = $(".tabBoxSm > .tabSm").eq(index).find('.tableHead').width();
					var tabodyH = $(".tabBoxSm > .tabSm").eq(index).find('.tableBody').height();
					var tableScrollH = $(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').height();
					if(tabodyH>tableScrollH){
						$(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').css('width',tableW + 18 + 'px')
					}else{
						$(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').css('width','inherit')
					}

                })

            })

        })
        
        //检索 
    function searchListForm() {
    	var params = $("#searchForm").serialize();
    	$("#activity_pane").showLoading();
		$.post("${ctx}/purchase/advance/searchList",params, function(result) {
			var listHtml = result["purchaseAdvance"];
			var pageHtml = result["page"];
			$("#listHtml").html(listHtml);
			$("#paging").html(pageHtml);
			$("#activity_pane").hideLoading();
		}, 'json');
	}
        
	//重置
	function clean() {
		$("input").val("");
		$("select").val("");
		searchListForm();
	}   
    </script>
    <style type="text/css">
    							.table-yfkbh{width: 100px;}
    							.table-yfkht{width: 100px;}
    							.table-yfkgys{width: 120px;}
		                        .table-yfkzl{width: 80px;}
		                        .table-yfkdlsl{width: 100px;}
		                        .table-yfkdlje{width: 100px;}
		                        .table-yfkje{width: 110px;}
		                        .table-yfkbl{width: 80px;}
		                        .table-yfkqx{width: 80px;}
		                        .table-yfkyy{width: 120px;}
		                        .table-yfkcjry{width: 80px;}
		                        .table-yfkcjrq{width: 80px;}
    </style>
</head>
<body>

<form id="searchForm">
<div class="listArea" id="activity_pane">
	<div class="listBg">
        <div class="searchArea clearfix">
            <div class="searchLeft clearfix">
            	<div class="searchInp clearfix">
                    <p><spring:message code="purchase_advance_advanceNumber" /></p>
                    <input class="w-styleNub" id="advanceNO" name="advanceNO" value="">
                </div>
                <div class="searchInp clearfix">
                    <p><spring:message code="purchase_advance_contractNumber" /></p>
                    <input class="w-styleNub" id="contractMaterialNO" name="contractMaterialNO" value="">
                </div>
                <div class="searchInp clearfix">
                    <p><spring:message code="purchase_advance_supplier" /></p>
                    <input class="w-customer" id="ognizationName" name="ognizationName" value="">
                </div>
                <div class="searchInp clearfix">
                    <p><spring:message code="purchase_advance_date" /></p>
                    <div class="timeBox">
							<input type="text" class="laydate-icon" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})"
								id="dateStart" name="dateStart" style="width: 110px">
							<p class="list">~</p>
							<input type="text" class="laydate-icon" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})" id="dateEnd" name="dateEnd"
								style="width: 110px" >
                    </div>        
                </div>               
            </div>
            <div class="searchRight clearfix">
                <button type="button" onclick="searchListForm();"><spring:message code="commom_check" /></button>
                <button type="button" onclick="clean();"><spring:message code="common_reset" /></button>
                <button type="button" onclick="popup('1000px','650px','${ctx}/purchase/advance/createAdvance')"><spring:message code="purchase_advance_create" /></button>
            </div>
        </div>
        </div>
        <input type="hidden" id="ulSelected" name="ulSelected" value="">
    
    <div class="tabBox">
        <ul class="clearfix">
            <li class="active" value="-1"><spring:message code="purchase_advance_all" /></li>
            <li value="5"><spring:message code="purchase_advance_new" /></li>
            <li value="2"><spring:message code="purchase_advance_audit_wait" /></li>
            <li value="1"><spring:message code="purchase_advance_audit_ok" /></li>
            <li value="0"><spring:message code="purchase_advance_audit_no" /></li>
            <li value="3"><spring:message code="purchase_advance_complete" /></li>
            <li value="4"><spring:message code="purchase_advance_delete" /></li>
        </ul>
	</div>
    <div class="listBg tabPadding overflowX">
        <div class="tableArea tabBoxSm">
            <div class="tableScroll tabSm" style = "height:650px">
                <table cellpadding="0" class="tableHead">
                    <thead>
                    <tr>
                        <th><p class="table-No"><spring:message code="common_no" /></p></th>
                        <th><p class="table-yfkbh"><spring:message code="purchase_advance_advanceNo" /></p></th>
                        <th><p class="table-yfkht"><spring:message code="purchase_advance_contractNo" /></p></th>
                        <th><p class="table-yfkgys"><spring:message code="purchase_advance_supplierB" /></p></th>
                        <th><p class="table-yfkzl"><spring:message code="purchase_advance_kinds" /></p></th>
                        <th><p class="table-yfkdlsl"><spring:message code="purchase_advance_quantity" /></p></th>
                        <th><p class="table-yfkdlje"><spring:message code="purchase_advance_amount" /></p></th>
                        <th><p class="table-yfkje"><spring:message code="purchase_advance_advanceAmount" /></p></th>
                        <th><p class="table-yfkbl"><spring:message code="purchase_advance_advanceRate" /></p></th>
                        <th><p class="table-yfkqx"><spring:message code="purchase_advance_advanceDueDate" /></p></th>
                        <th><p class="table-yfkyy"><spring:message code="purchase_advance_advanceReason" /></p></th>
                        <th><p class="table-yfkcjry"><spring:message code="purchase_advance_creator" /></p></th>
                        <th><p class="table-yfkcjrq"><spring:message code="purchase_advance_createDate" /></p></th>
                    </tr>
                    </thead>
                </table>
                <table cellpadding="0" class="tableBody">
                    <tbody id="listHtml">
                    <tr>                        
                    </tr>
                    </tbody>
                </table>
            </div>            
        </div>
    </div>
    <div id = "paging" ></div>  
<script type="text/javascript">
$(document).ready(function(){
	searchListForm();
	
	});

</script> 
</div>
</form>
</body>
</html>
